package wallpaperCtrl;

import command.CommandLinux;

import java.io.IOException;

public class WallpaperCtrlUKUILinux implements WallpaperCtrl{
    private static final WallpaperCtrlUKUILinux wallpaperCtrlUKUILinux;
    static {
        wallpaperCtrlUKUILinux=new WallpaperCtrlUKUILinux();
    }

    @Override
    public void setPictureWallpaper(String path) {
        String[] args = new String[]{"/bin/bash", "-c", "gsettings set org.mate.background picture-filename " + "'" + path + "'"};
        String s = null;
        try {
            s = CommandLinux.oSCommandStatic(args);
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println(s);
        }
    }

    public static void setPictureWallpaperStatic(String path){
        wallpaperCtrlUKUILinux.setPictureWallpaper(path);
    }

    @Override
    public void setLiveWallpaper(String path) {
    }

    public static void setLiveWallpaperStatic(String path){
        wallpaperCtrlUKUILinux.setLiveWallpaper(path);
    }
}
